<?php

namespace app\api\controller;
use app\api\common\Common;
use app\api\common\ApiErrDesc;

class Shopping extends Common {

    // 添加到购物车
    public function add() {
        $data = $this->params;
        $check = db('product')->where('id='.$data['pid'].' AND del = 0 AND is_down = 0')->find();
        if(!$check){
            $this->return_msg(ApiErrDesc::PRODUCTSDOWN[0], ApiErrDesc::PRODUCTSDOWN[1]);
            exit();
        }

        $check_info = db('product')->where('id='.$data['pid'].' AND del=0 AND is_down=0')->find();
    }
}